package com.ljx.NoteBody.controller;

import com.ljx.NoteBody.common.R;
import com.ljx.NoteBody.service.AgreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api/agree")
public class AgreeController {

    @Autowired
    AgreeService agreeService;

    @PostMapping("/{commentId}")
    public R<String> changeAgree(@PathVariable("commentId") Long commentId,
                                 HttpServletRequest request){
        agreeService.changAgree(commentId, request);
        return R.success("点赞成功");
    }
}
